package com.itheima.d1_method;

public class Test26 {
    public static void main(String[] args) {
        int[] a = {1, 2, 3, 4, 5};
        test(a);


    }

    public static void test(int[] a) {
        if (a == null) {
            System.out.println("null");
            return;
        }
        if (a.length == 0) {
            System.out.println("[]");
            return;
        }
        System.out.print("[");
        for (int i = 0; i < a.length; i++) {
            if (i != a.length - 1) {
                System.out.print(a[i] + ",");
            } else {
                System.out.print(a[i] + "]");
            }
        }
    }

}

